package Str_Obj_Package;

class Singleton1{
    private static Singleton1 B = new Singleton1();
    private Singleton1() {

    }
    public static Singleton1 make(){
        return B;
    }
}

class Singleton {
    private static Singleton A;
    private Singleton() {
    }
    public static Singleton make() {
        if(A == null){
            A = new Singleton();
        }
        return A;
    }
}

public class Test_4 {
    public static void main(String[] args) {
        Singleton tmp = Singleton.make();
        Singleton tmp1 = Singleton.make();

        Singleton1 tmp2 = Singleton1.make();
        Singleton1 tmp3 = Singleton1.make();


        System.out.println(tmp);
        System.out.println(tmp1);

        System.out.println("--------我是分割线---------");

        System.out.println(tmp2);
        System.out.println(tmp3);

    }
}
